package center

import (
	"base"
	. "center_server/logic/internal"
	"leaf/gate"
	"proto/server/center"
)

type centerService struct {
}

func init() {
	service := new(centerService)
	Protocol.Register(new(proto_server_center.Register), service.register)
}

func (*centerService) register(args []interface{}) {
	msg := args[0].(*proto_server_center.Register)
	base.Logger.Release("center service register, %s", msg)

	agent := args[1].(gate.Agent)
	system.register(agent, msg.Server, msg.Data)
}
